package com.tingyuge.base.thread.pool;

import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author xiaodao
 * @version 1.0
 * @date 2021/2/17
 */
public class Test {
    public static final AtomicInteger atomic = new AtomicInteger(0);
    public static void main(String[] args) throws InterruptedException {
        ThreadPoolExecutor executor = ThreadPoolUtil.getInstance(Test.class.getSimpleName());
        executor.allowCoreThreadTimeOut(true);
        for (int i = 0; i < 10; i++) {
            executor.submit(()->{
                System.out.println(Thread.currentThread().getName());
            });
        }

    }
}
